package scorecard

import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils

class ApplicationUserInfoTagLib {


    static namespace = "userinfo"

    def loggedInUserInfo = { attrs,body ->
        // By default trigger onclick, but allow onmouseover etc

        def authority =  SpringSecurityUtils.getPrincipalAuthorities();
        Set<String> roles =  SpringSecurityUtils.authoritiesToRoles(authority)

        out << """Roles: ${roles.toListString()}"""
    }

}
